
/*
	测试led_drv.c驱动程序

*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main(void)
{
	int fd;
	int ret = -1;
	fd = open("/dev/led", O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}
    ret=  write(fd, "on", 2); 
	sleep(2);
	ret=  write(fd, "off",  3);
	sleep(2);
    ret=  write(fd, "on", 2); 
	sleep(2);
	ret=  write(fd, "off",  3);

	

	close(fd);
	printf("main exit\n");
	return 0;
}


